package io.starteos.wallet.utils.eos;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;

public class HttpUtils {

	@SuppressWarnings("deprecation")
	public static String post(String url, String body) throws Exception {
		String info = null;
		HttpClient httpclient = new HttpClient();
		PostMethod post = new PostMethod(url);
		post.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, "utf-8");
		post.setRequestBody(body);

		httpclient.executeMethod(post);
		info = new String(post.getResponseBody(), "utf-8");
		return info;
	}

}